home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-13 | 2.7 KB | 65 lines | [TEXT/KAHL] |
- //------------------------- © 1994-1995 by James G. Stout ---------------------------
- // File : cdefVSlider.h
- // Date : April 6, 1994
- // Author : Jim Stout
- // :
- // Purpose : A slider CDEF modeled after the one in the Sound Control panel
- // : 4 variation codes are supported (see below).
- // :
- // : This control has some non-standard behaviors.
- // :
- // : 1. It has a semi-fixed size (does not scale like a scrollbar).
- // : 2. Specify the size in 'units' for the control by passing
- // : a number between 2 & 20 in the control refCon. It will
- // : default to 7 (as in the Sound Control panel).
- // : 3. The control rect should be 42 wide and 21 + (12 * units) high
- // : or it will be clipped when drawn.
- // : 4. Control Min & Max will be filled in for you.
- // : Min = 0
- // : Max = 12 * units (84 for default size)
- // : 5. There is no control title.
- // :
- // : If you find a use for this, I'd love to know about it. Bug reports
- // : are always interesting.
- // :
- // : Internet : JimS@WRQ.COM(work hours, PST)
- // : AppleLink : WRQ (daily)
- // : CompuServe : 73240,2052 (weekly or so)
- // : AOL : JasG (weekly or so)
- // : eWorld : Jim Stout (weekly or so)
- //----------------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------------
- // Variation codes
- //----------------------------------------------------------------------------------
-
- #define scaleNoFill 0x0001 // no gray pattern inside scale
- #define ctl3D 0x0002 // 3D effect
- #define thumbNoSnap 0x0004 // don't snap thumb to scale values
- #define scaleBlank 0x0008 // don't show scale values
-
- //----------------------------------------------------------------------------------
- // CDEF private data structure
- //----------------------------------------------------------------------------------
-
- typedef struct {
- CGrafPtr offPort;
- Rect scaleRect;
- short scaleSize;
- short pDepth;
- short qdVers;
- }CDEFData,**CDEFHandle;
-
- //----------------------------------------------------------------------------------
- // Function prototypes
- //----------------------------------------------------------------------------------
-
- static void doInit (ControlHandle theControl);
- static void doDisp (ControlHandle theControl);
- static long doTest (ControlHandle theControl, short varCode, long param);
- static void dragThumb (ControlHandle theControl, short varCode, long param);
- static void scaleClick (ControlHandle theControl, short varCode, short partCode);
- static void getThumbRect (ControlHandle theControl, Rect * rThumb, Rect * rScale);
- static Boolean drawParts (ControlHandle theControl, short varCode, Rect * rThumb);
- static void doDraw (ControlHandle theControl, short varCode);
-